.class final Lcom/burstly/lib/network/request/ConverterFactory;
.super Ljava/lang/Object;
.source "ConverterFactory.java"


# static fields
.field private static final CACHE:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/burstly/lib/network/request/IResponseConverter",
            "<*>;>;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 34
    new-instance v0, Ljava/util/HashMap;

    const/4 v1, 0x5

    invoke-direct {v0, v1}, Ljava/util/HashMap;-><init>(I)V

    sput-object v0, Lcom/burstly/lib/network/request/ConverterFactory;->CACHE:Ljava/util/Map;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 39
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 40
    return-void
.end method

.method static getConverter(Ljava/lang/Class;)Lcom/burstly/lib/network/request/IResponseConverter;
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class",
            "<TT;>;)",
            "Lcom/burstly/lib/network/request/IResponseConverter",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 51
    .local p0, targetClass:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    invoke-virtual {p0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v1

    .line 52
    .local v1, key:Ljava/lang/String;
    sget-object v2, Lcom/burstly/lib/network/request/ConverterFactory;->CACHE:Ljava/util/Map;

    invoke-interface {v2, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 53
    sget-object v2, Lcom/burstly/lib/network/request/ConverterFactory;->CACHE:Ljava/util/Map;

    invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/burstly/lib/network/request/IResponseConverter;

    .line 57
    :goto_0
    return-object v2

    .line 55
    :cond_0
    invoke-static {p0}, Lcom/burstly/lib/network/request/ConverterFactory;->getSpecificConverter(Ljava/lang/Class;)Lcom/burstly/lib/network/request/IResponseConverter;

    move-result-object v0

    .line 56
    .local v0, conv:Lcom/burstly/lib/network/request/IResponseConverter;,"Lcom/burstly/lib/network/request/IResponseConverter<TT;>;"
    sget-object v2, Lcom/burstly/lib/network/request/ConverterFactory;->CACHE:Ljava/util/Map;

    invoke-interface {v2, v1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move-object v2, v0

    .line 57
    goto :goto_0
.end method

.method private static getSpecificConverter(Ljava/lang/Class;)Lcom/burstly/lib/network/request/IResponseConverter;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class",
            "<TT;>;)",
            "Lcom/burstly/lib/network/request/IResponseConverter",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 68
    .local p0, targetClass:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    const-class v0, Lcom/burstly/lib/network/ResponseObject;

    invoke-virtual {p0, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 69
    new-instance v0, Lcom/burstly/lib/network/request/ConverterFactory$1;

    invoke-direct {v0}, Lcom/burstly/lib/network/request/ConverterFactory$1;-><init>()V

    .line 95
    :goto_0
    return-object v0

    .line 77
    :cond_0
    const-class v0, Lcom/burstly/lib/network/beans/ResponseBean;

    invoke-virtual {p0, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    const-class v0, Lcom/burstly/lib/network/beans/TrackClickResult;

    invoke-virtual {p0, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 78
    :cond_1
    new-instance v0, Lcom/burstly/lib/network/request/ConverterFactory$2;

    invoke-direct {v0, p0}, Lcom/burstly/lib/network/request/ConverterFactory$2;-><init>(Ljava/lang/Class;)V

    goto :goto_0

    .line 85
    :cond_2
    const-class v0, Ljava/lang/String;

    invoke-virtual {p0, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 86
    new-instance v0, Lcom/burstly/lib/network/request/ConverterFactory$3;

    invoke-direct {v0}, Lcom/burstly/lib/network/request/ConverterFactory$3;-><init>()V

    goto :goto_0

    .line 95
    :cond_3
    const/4 v0, 0x0

    goto :goto_0
.end method
